﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    //定义一个员工类，存放用户的工号、姓名、性别、学历和部门信息；
    //定义两个构造函数:
    //一个是无参构造函数，学历默认为专科；
    //一个有参构造函数，根据参数对类的属性进行初始化。
    class Staff
    {
        public float Id { get; set; }
        public string Name { get; set; }
        public string Sex { get; set; }
        public string Educa { get; set; }
        public string Dept { get; set; }

        //public Staff()
        //{
        //    this.Educa = "专科";

        //}

        public Staff(float id,string name,string sex,string educa,string dept)
        {
            this.Id = id;
            this.Name = name;
            this.Sex = sex;
            this.Educa = educa;
            this.Dept = dept;
        }

        public void Test()
        {
            Console.WriteLine("工号："+this.Id);
            Console.WriteLine("姓名："+this.Name);
            Console.WriteLine("性别："+this.Sex);
            Console.WriteLine("学历："+this.Educa);
            Console.WriteLine("部门信息："+this.Dept);
        }
    }
}
